using IQIGame.Onigao.Framework;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay
{
    public abstract class SmallPetBaseMoveBehavior : IReusableClass
    {
        public SmallPetEntity entity { get; set; }

        public virtual void Init()
        {
            MsgDispatcher.AddListener<float>(MsgEventType.EntityStartMove, OnEntityStartMove);
        }

        public virtual void OnReset()
        {
            MsgDispatcher.RemoveListener<float>(MsgEventType.EntityStartMove, OnEntityStartMove);
        }

        private void OnEntityStartMove(float stickPower)
        {
            OnOwnerMove(entity.owner.transform.position, stickPower);
        }

        public abstract void OnUpdate(float dt);
        public abstract uint MaxStore { get; }
        public abstract void OnOwnerMove(Vector3 pos, float speedPower);
    }
}